<!--
    This page is the main page and all other pages are included on this page
-->
<!DOCTYPE html>
<?php
//enable you to use the session variables
session_start();
if(isset($_SESSION["image"])){
    unset($_SESSION["image"]);
}
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <link rel="stylesheet" href="./stylesheet.css" />
    </head>
    <body>
    <center>
        <div id="header">
            <!-- This is the two links shown in the top right corner of the website -->
            <div id="head"> 
                <div style="font-size: 20px;">
                    <br/><br/>
                </div>
                    Hangman
            </div>
            <!-- this is your menu - you can also include images -->
            <div id="menu">
                <table width="100%" >
                    <tr align="center" valign="middle">
                        <!-- the following line includes the page parameter -->
                        <td><a href="./?page=home" class="indexLinks">Home</a></td>
                        <td><a href="./?page=cheats" class="indexLinks">Cheats & Hints</a></td>
                        <td><a href="./?page=gallery" class="indexLinks">Gallery</a></td>
                    </tr>
                </table>
            </div>
        </div>
        <div id="content">
            <?php
            //check if the parameter exists
            if (isset($_REQUEST["page"])) {
                //includes a page according to the parameter received
                if ($_REQUEST["page"] === "home") {
                    include './PHP/Home.php';
                } else if ($_REQUEST["page"] === "cheats") {
                    include './PHP/Cheats.php';
                } else if ($_REQUEST["page"] === "gallery") {
                    include './PHP/Gallery.php';
                } else if ($_REQUEST["page"] === "displaySelectedImage") {
                    $_SESSION["image"] = $_REQUEST["image"];
                    include './PHP/Image.php';
                } else {
                    echo 'There is no information for this page';
                }
            } else {
                ?>
            <h1>Welcome to Hangman</h1>
            <br/>
            <img src="./Images/Intro.png" style="width: 80%;"/>
            <?
            }
            ?>
        </div>
        <div id="footer">
            Hangman &copy; Author: André Smink & Lourens Götze
        </div>            
    </center>
    <?php
// put your code here
    ?>
</body>
</html>
